<template>
	<view class="home_tit">
		<view class="home_tit_top">
			<view class="tit_top">
				<input v-model="title" type="text" :placeholder="$t('category.c0')" />
				<view class="imgsearch" @click="callParentMethod">
					<image class="w-40 h-40 m-10" src="@/static/imgs/search.png" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			title: ''
		};
	},
	onLoad() {},
	methods: {
		callParentMethod(e) {
			this.$emit('customevent', this.title); // 触发父组件监听的事件并传递参数
		}
	}
};
</script>

<style lang="scss" scoped>
.home_tit {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 1000;
	background-repeat: no-repeat;
	background-size: 100%;
	width: 100%;
	.home_tit_top {
		background: rgb(245, 245, 248);
		height: 50px;
		padding: 0 15px;
		display: flex;
		align-items: center;
		.tit_top {
			background: rgb(255, 98, 65);
			border-radius: 10px;
			display: flex;
			align-items: center;
			height: 45px;
			width: 100%;
			padding: 0px 15px;
			input {
				font-size: 13px;
				height: 30px;
				line-height: 30px;
				padding-left: 14px;
				background: rgb(255, 255, 255);
				flex: 1 1 0%;
				border-radius: 10px;
			}
			.imgsearch {
				width: 30px;
				height: 30px;
				border-radius: 10px;
				background: rgb(255, 255, 255);
				margin-left: 10px;
			}
		}
	}
}
</style>
